/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.bridge;

import java.util.Iterator;
import ru.jSkyRoom.interfaces.major.Major;
import skyproc.FormID;

/**
 *
 * @author Rakev
 */
public class IteratorFormIdFinder<E extends FormID, B extends Major> extends JSkyBridge<Iterator<E>> implements Iterator<B> {

    public IteratorFormIdFinder(Iterator<E> adapting) {
        super(adapting);
    }

    @Override
    public boolean hasNext() {
        return getRawObject().hasNext();
    }

    @Override
    public B next() {
        E nextElement = getRawObject().next();
        return (B) getFinderFactory().createMajorFinder().find(nextElement);
    }

    @Override
    public void remove() {
        getRawObject().remove();
    }
}
